Ext.define('AmpleHarvest.DATA.Store.AppSearchStore',
{
   extend      : 'Ext.data.Store',
   alias: 'widget.ampleharvest.data.store.appsearchStore',
   
   model       : 'AmpleHarvest.DATA.Model.AppSearchResult',
   autoLoad: false,   //autoLoad: {start: 0, limit:10},
   appendId: false,
   
   clearOnPageLoad: true,
   pageSize    : 50,
   remoteSort     : false,
   proxy:
   {
      simpleSortMode : true,
      type        : 'rest',
      headers: {'X-ProxiedEntitiesChain': obj_config.user.dn},
      url            : '/gs/app/search?query=',//?limit=100',
      startParam     : 'offset',
      reader         :
      {
         type        : 'json',
         root        : 'collection',
         totalProperty  : 'totalCount'
      }
   },
   
   constructor: function(config) {
        //this.proxy.url = '/gs/app/search?query=' + config.searchParam;

        this.callParent(arguments);
    },
    
    loadSearchParam: function(searchParam)
    {
    	this.proxy.url = '/gs/app/search?query=' + searchParam //+ '&limit=50';
    }
}
);